package wizard;


import javax.microedition.lcdui.*;
import javax.microedition.pim.Contact;

/**
 * Wizard Design Pattern.
 * Wizard dialog 2.
 *
 * @author Ben Hui
 */


public class WPage2 extends WDialog
{
	TextField nombre;
	TextField apellidos;

  public WPage2()
  {
  }



  public void initDialog()
  {
    setTitle("Introduzca Nombre y Apellidos");
    nombre= new TextField("Nombre:","",10,TextField.ANY);
    apellidos= new TextField("Apellido:","",10,TextField.ANY);
    append( nombre );
    append( apellidos );
  }

  public int onLeave( int dir )
  {
    if ( dir == WDialog.FORWARD )
    {
      String[] name;
	if (nombre.getString().equals(new String(""))){
    	  //return WDialog.REJECT;
		return WDialog.OK;
    } else
    	  	/*name = new String[Wizardlet.instance.contList.stringArraySize(Contact.NAME)];
      		name[Contact.NAME_GIVEN] = nombre.getString();
  			name[Contact.NAME_FAMILY] = apellidos.getString();
  			Wizardlet.instance.ct.addStringArray(Contact.NAME, Contact.ATTR_NONE, name);
  			*/
          return WDialog.OK;

    } else
    
      return WDialog.OK;
      
  }

}